import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  /* config options here */
  // devIndicators: false
  webpack: (config, { isServer }) => {
    // 在客户端构建中提供空模块，解决 fs 模块问题
    if (!isServer) {
      config.resolve.fallback = {
        ...config.resolve.fallback,
        fs: false,
        path: false,
        crypto: false,
      };
    }
    return config;
  },
  // Turbopack 配置
  experimental: {
    turbo: {
      resolveAlias: {
        fs: 'false',
        path: 'false',
        crypto: 'false',
      },
    },
  },
};

export default nextConfig;
